import * as api from './api'

export default {
  // 登录
  login: (params) => {
    const headers = {
      'lang-key': 'login'
    }
    return api.post('/manage/login', params, headers)
  },
  // 退出登录
  logout: () => {
    const headers = {
      'lang-key': 'logout'
    }
    return api.del('/manage/login', null, headers)
  },
  // 修改密码
  modifyPassword: (id, oldPassword, newPassword) => {
    const headers = {
      'lang-key': 'resetPasswords'
    }
    return api.put(`/manage/sys-users/password/${id}?oldPassword=${oldPassword}&newPassword=${newPassword}`, null, headers)
  },
  // 获取系统配置列表
  getSystemConfigList: () => {
    return api.get('/manage/common/configs')
  },
  // 获取国家码下拉列表
  getCountryCodeList: () => {
    return api.get('/manage/country/box')
  },

  // 上传文件
  uploadFile: (params) => {
    return api.uploadFile(params)
  }
}
